<template>
  <div>
    <el-row>
      <el-card style="background-color: white">
        <el-form>
          <el-row>
            <el-form-item
              style="width: 33%; float: right"
              v-for="(item, index) in formDataText"
              :key="index"
              :label="item.labels"
            >
              <el-input
                style="width: 50%"
                v-for="(val, key) in formData[index]"
                :key="key"
                v-model="formDateObj1[key]"
                :placeholder="`请输入${item.text}`"
              >
              </el-input>
            </el-form-item>
          </el-row>
          <el-row>
            <el-col>
              <el-button
                style="margin-left: 20px"
                @click="submit"
                type="primary"
                >搜索</el-button
              >
              <el-button @click="reset">重置</el-button>
            </el-col>
          </el-row>
        </el-form>
      </el-card>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formDateObj1: "",
    };
  },
  props: {
    formDateObj: {
      type: Object,
    },
    formData: {
      type: Array,
    },
    formDataText: {
      type: Array,
    },
  },
  created() {
    this.DateChange();
  },
  methods: {
    submit() {
      console.log(this.formDateObj1);
    },
    reset() {
      for (const key in this.formDateObj1) {
        this.formDateObj1[key] = "";
      }
    },
    DateChange() {
      this.formDateObj1 = this.formDateObj;
    },
  },
};
</script>

<style lang="scss" scoped>
.el-form {
  ::v-deep .el-form-item__label {
    width: 110px;
  }
}
</style>
